<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>lastChild</title>
    </head>
    <body>

        <p>列表示例：</p>
        <ul id="myList">
            <li>Coffee</li>
            <li>Tea</li>
        </ul>

        <p id="demo">请点击按钮来获得列表最后一个子节点的节点名。</p>

        <button onclick="myFunction()">试一下</button>

        <script type="text/javascript" src="lastChild.js"></script>
    </body>
</html>